Skip to main content

customreports

Table: customreports

The customreports table stores user-defined queries and reports for data analysis and reporting purposes.
It allows dynamic creation, editing, and execution of custom reports within the system.


Columns

Column NameData TypeConstraintsDescription
queryIdint(11)NOT NULL, AUTO_INCREMENTUnique identifier for each custom report
voidedtinyint(4)NULLSoft deletion flag (1 = voided, 0 = active)
labelvarchar(450)NULLDisplay label for the report
queryNamevarchar(450)NOT NULLName of the report/query
descriptionvarchar(450)NULLDescription of the report purpose
additionalDetailsvarchar(450)NULLAny additional information about the report
queryvarchar(45000)NULLThe SQL or query definition for the report
dateRangetinyint(4)DEFAULT 0Flag indicating if the report uses a date range filter
locationFiltertinyint(4)DEFAULT 0Flag indicating if the report uses a location filter
createdByUserIdint(11)NULLUser who created the report
lastEditedByUserIdint(11)NULLUser who last edited the report
createdDatedatetimeNULLTimestamp when the report was created
lastEditedDatedatetimeNULLTimestamp when the report was last modified

Indexes

  1. PRIMARY - Primary key on queryId
  2. user_customReport_idx - Index on createdByUserId
  3. lastEdited_user_CustomReport_idx - Index on lastEditedByUserId

Foreign Key Relations

  1. user_customReport

    • createdByUserIduser.mappedId
    • Tracks the creator of the report
  2. lastEdited_user_CustomReport

    • lastEditedByUserIduser.mappedId
    • Tracks the last editor of the report

Usage Notes

  • Supports dynamic creation and execution of custom reports.
  • voided flag allows soft deletion of reports without removing data.
  • dateRange and locationFilter define report filtering capabilities.
  • Audit fields (createdByUserId, lastEditedByUserId, createdDate, lastEditedDate) maintain history.
  • Allows users to store queries up to 45,000 characters in query.